#ifndef __THREAD_POOL__
#define __THREAD_POOL__

#include "func.h"
#include "taskQueue.h"
#include "dirStack.h"

typedef struct threadPool_s {
    int workerNum;
    pthread_t *tidArr;
    taskQueue_t taskQueue;
    pthread_mutex_t mutex;
    pthread_cond_t cond;
} threadPool_t;

int initThreadPool(int workerNum, threadPool_t *pthreadPool);
int makeWorker(threadPool_t *pthreadPool);
int taskHandler(int netfd);
void *threadFunc(void *arg);
int tcpInit(char *ip, char *port, int *psockfd);
int epollAdd(int epfd, int fd);
int epollDel(int epfd, int fd);
#endif
